<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fregments :: head(~{::title})">
    <meta charset="UTF-8">
    <!--移动端更好的适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索结果</title>
    <link rel="stylesheet" href="../static/dist/semantic/semantic.min.css" th:href="@{/dist/semantic/semantic.min.css}">
    <link rel="stylesheet" href="../static/css/my.css" th:href="@{/css/my.css}">
</head>
<body>
<!--    导航-->
<nav th:replace="_fregments :: menu(1)" class="ui segment inverted attached m-padded-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">ZBlog</h2>
            <a href="#" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a href="#" class="m-item item m-mobile-hide active"><i class="tags icon"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
            <div class="m-item right item m-mobile-hide">
                <div class="ui inverted transparent icon input">
                    <input type="text" placeholder="搜索...">
                    <i class="search icon link"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui m-menu m-toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--    中间内容-->
<div class="m-container-small m-padded-big">
    <div class="ui container">
        <!--        头部-->
        <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">搜索结果</h3>
                </div>
                <div class="column right aligned">
                    共
                    <h2 class="ui header orange m-text-thin m-inline-block" th:text="${page.total}">14</h2>
                    条
                </div>
            </div>
        </div>
        <!--        头部结束-->


        <!--    标签博客列表-->
        <div class="ui top attached segment teal">
            <div class="ui padded vertical segment" th:each="blog : ${page.records}">
                <div class="ui padded segment vertical">
                    <div class="ui middle aligned stackable grid mobile reversed">
                        <div class="eleven wide column">
                            <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank"
                                                     th:text="${blog.title}" class="m-black">JVM内存模型</a></h3>
                            <p class="m-text" th:text="|${blog.description}...|">
                                最近学习了一下JVM的内存模型，本来想自己写一篇学习心得，总是觉得自己表达不清，然后就从学习资料里复制一段，写到最后发现，基本都是复制的
                            </p>
                            <div class="ui grid">
                                <div class="eleven wide column">
                                    <div class="ui horizontal link list mini">
                                        <div class="item">
                                            <img src="../static/images/me.jpg" th:src="@{${blog.user.avatar}}"
                                                 class="ui avatar image" alt="">
                                            <div class="content">
                                                <a href="#" class="header" th:text="${blog.user.nickname}">dylan</a>
                                            </div>
                                        </div>
                                        <div class="item">
                                            <i class="calendar icon"></i><span
                                                th:text="${#dates.format(blog.updateTime, 'yyyy-MM-dd')}">2023-4-14</span>
                                        </div>
                                        <div class="item">
                                            <i class="eye icon"></i><span th:text="${blog.viewCnt}"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="right aligned eight five wide column">
                                    <a href="#" target="_blank" class="ui teal basic label m-padded-mini m-text-thin"
                                       th:text="${blog.type}">
                                        学习笔记
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="five wide column">
                            <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                <img src="../static/images/test.jpg" th:src="@{${blog.firstPicture}}"
                                     class="ui rounded m-image-size-square image">
                            </a>
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <!--    尾部-->
        <div class="ui bottom attached segment" th:if="${page.pages} > 1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a href="#" th:href="@{/(pageNo=${page.hasPrevious}?${page.current - 1}:${page.current})}"
                       class="ui mini basic teal button" th:if="${page.hasPrevious}">上一页</a>
                </div>
                <div class="column right aligned">
                    <a href="#" class="ui mini basic teal button"
                       th:href="@{/(pageNo=${page.hasNext}?${page.current + 1}:${page.current})}"
                       th:if="${page.hasNext}">下一页</a>
                </div>
            </div>
        </div>
    </div>
</div>

<!--    页脚-->


<!--/*/<th:block th:replace="_fregments :: script">/*/-->
<script rel="script" src="../static/dist/jquery/jquery-3.4.1.min.js"
        th:src="@{/dist/jquery/jquery-3.4.1.min.js}"></script>
<script rel="script" src="../static/dist/semantic/semantic.js" th:src="@{/dist/semantic/semantic.js}"></script>
<!--/*/</th:block>/*/-->

<script>
    $('.m-menu.m-toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

</script>
</body>
</html>